package com.example.vp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.vp.domian.enetity.Collect;
import com.example.vp.domian.enetity.CollectDetails;
import com.example.vp.mapper.CollectMapper;
import com.example.vp.service.CollectService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectServiceImpl extends ServiceImpl<CollectMapper, Collect> implements CollectService {
    @Override
    public void collect(Long collectId,Long videoId) {
        baseMapper.insertCollect(collectId,videoId);
    }

    @Override
    public List<Collect> getCollect(Long userId) {
        List<Collect> list = list(new LambdaQueryWrapper<Collect>().eq(Collect::getUserId, userId));
        return list;
    }
}
